<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserVisitsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_visits', function (Blueprint $table) {
            $table->id()->comment('用户访问表');
            $table->integer('user_id')->index()->comment('访问用户id');
            $table->string('url',255)->comment('访问路径');
            $table->string('ip',32)->comment('访问用户ip');
            $table->integer('stay_time')->comment('页面停留时间(秒)');
            $table->string('channel_type',255)->comment('用户访问端表示');
            $table->string('province',32)->comment('所在省分');
            $table->string('content',255)->comment('内容');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_visits');
    }
}
